using GameFramework;
using GameFramework.Event;
using System;
using UnityGameFramework.Runtime;

namespace LS.Event
{
    public abstract class LSGameEventArgs : GameEventArgs
    {
        public static T Create<T>()
            where T : LSGameEventArgs, IReference, new()
        {
            T arg = ReferencePool.Acquire<T>();
            return arg;
        }

        public override void Clear()
        {
            
        }
    }
    
    public abstract class LSGameEventArgs<T> : LSGameEventArgs where T : GameEventArgs, IReference, new()
    {
        public static readonly int EventId = typeof(T).GetHashCode();

        public override int Id => EventId;

        public override void Clear()
        {
            
        }
        
        public static T Create<T>()
            where T : LSGameEventArgs, IReference, new()
        {
            T arg = ReferencePool.Acquire<T>();
            return arg;
        }

    }
}